//
//  WHTreeItem.h
//  WHValueKit
//
//  Created by peng wang on 2023/2/21.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, WHTreeItemCheckState)
{
	WHTreeItemDefault,      	// 不选择（默认）
	WHTreeItemChecked,      	// 全选
	WHTreeItemHalfChecked,  	// 半选
	WHTreeItemFixedChecked,		// 固定选中（不可再编辑）
};

@interface WHTreeItem : NSObject

@property (nonatomic, copy) 		  NSString *name;      // 节点名称
@property (nonatomic, readonly, copy) NSString *ID;        // 节点唯一标识
@property (nonatomic, readonly, copy) NSString *parentID;  // 父节点唯一标识
@property (nonatomic, readonly, copy) NSString *orderNo;   // 节点序号
@property (nonatomic, readonly, copy) NSString *type;      // 节点类型
@property (nonatomic, assign) 		  BOOL isLeaf;		   // 是否为叶子节点
@property (nonatomic, readonly, strong) id data;           // 原始数据

// 下列数据为 WHTreeManager 中内部设置，不能在外部直接设置
@property (nonatomic, assign) NSUInteger level;
@property (nonatomic, assign) BOOL isExpand;
@property (nonatomic, assign) WHTreeItemCheckState checkState;
@property (nonatomic, weak)   WHTreeItem *parentItem;
@property (nonatomic, strong) NSMutableArray<WHTreeItem *> *childItems;

// 初始化
- (instancetype)initWithName:(NSString *)name
						  ID:(NSString *)ID
					parentID:(NSString *)parentID
					 orderNo:(NSString *)orderNo
						type:(NSString *)type
					  isLeaf:(BOOL)isLeaf
						data:(id)data;

@end
